#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
if sys.platform == "darwin":
    adbpath = "adb "
else:
    adbpath = "/usr/bin/adb "
if (sys.argv.__len__())<4:
    print( "参数个数少了")
    exit(0)
handset = sys.argv[1]
currentHandsetSnumber = sys.argv[2]
command = sys.argv[3]


def clearAll(handset,currentHandsetSnumber):
    print("回到待机Function clearAll called")
    os.system(adbpath + currentHandsetSnumber + " shell input keyevent 3")
    os.system(adbpath + currentHandsetSnumber + " shell input keyevent 187")
def onlyBack(handset,currentHandsetSnumber):
    print("回到待机Function onlyBack called")
    os.system(adbpath + currentHandsetSnumber + " shell input keyevent 3")

if command =="clearAll".strip():
    clearAll(handset,currentHandsetSnumber)
if command =="onlyBack".strip():
    onlyBack(handset,currentHandsetSnumber)